﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PhoneRater
{
    public partial class ReferenceBooksForm : Form
    {
        public ReferenceBooksForm()
        {
            InitializeComponent();
        }

       
        private void ReferenceBooksForm_Load(object sender, EventArgs e)
        {
            this.mvzCodesTableAdapter.Fill(this.referenceBooksDataSet.MvzCodes);
            this.employeesTableAdapter.Fill(this.referenceBooksDataSet.Employees);
            this.departmentsTableAdapter.Fill(this.referenceBooksDataSet.Departments);

        }

        private void BtOkClick(object sender, EventArgs e)
        {
            this.Validate();
            this.departmentsBindingSource.EndEdit();
            this.employeesBindingSource.EndEdit();
            this.mvzCodesBindingSource.EndEdit();

            this.tableAdapterManager.UpdateAll(this.referenceBooksDataSet);

            Close();
        }

        private void departmentsBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.departmentsBindingSource.EndEdit();
            this.tableAdapterManager.UpdateAll(this.referenceBooksDataSet);

        }

    }
}
